package array

import "fmt"

// Join 将数组转换为字符串
func Join[T any](array []T, separator string) string {
	var result string
	for i, v := range array {
		if i == 0 {
			result = fmt.Sprintf("%v", v)
		} else {
			result = fmt.Sprintf("%v%v%v", result, separator, v)
		}
	}
	return result
}
